home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.2
/
Video Toaster v4.2.iso
/
arexx
/
cg
/
import.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-11
|
3KB
|
99 lines
/* Import.rexx -- Import Graphics Via Hiip. */
/* By Bob Caron © 1994 NewTek, Inc. */
/* A Big hello to everybody on #amiga - Grue */
call addlib(CG_AREXX,0)
if ~exists("Toaster:Brushes") then address command "c:makedir toaster:Brushes"
address command "c:assign hiip: toaster:programs/hiip_support"
if ~exists("hiip:") then do
call req_tell("Error! Hiip_Support","Is missing.")
exit
end
if ~exists("c:gnusto") then do
call req_tell("Error! The Program","Gnusto Is missing!")
exit
end
width=0
height=0
if GET_LINE(TYPE) = 'Box' then do
width=word(get_rect(SIZE),1)
height=word(get_rect(SIZE),2)
end
if (width+height)<=0 then do
call req_tell("Error: You must create a box","and then select it.")
exit
end
filnam = 'ENV:CGImport.state'
version = 'Import v1.4'
if (exists(filnam)) then do
if (~open(state, filnam, 'R')) then break
if (readln(state) ~= version) then break
file=readln(state)
end
call close state
if file~="" | file="FILE" then do
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
end
if file="FILE" | file="" then do
path="Toaster:images"
filenam=""
end
infile=REQ_file("Choose a graphic file:",filenam,path)
if infile="" then
exit
file=script
if (open(state, filnam, 'W')) then do
call writeln state, version
call writeln state, infile
call close state
end
if req_ask("Peserve Aspect?") then width=0
if lastpos('/',infile,length(infile)-1)~=0 then do
filenam=right(infile,(length(infile)-lastpos('/',infile,length(infile)-1)))
path=left(infile,(lastpos('/',infile,length(infile))-1))
end
else do
filenam=right(infile,(length(infile)-lastpos(':',infile,length(infile)-1)))
path=left(infile,(lastpos(':',infile,length(infile))))
end
call req_bar("Converting Graphic...")
address command "C:gnusto "||infile||" Toaster:brushes/"||value(filenam)||"."||value(height)||" image saver iff sy "||value(height)||" sx "||value(width)||" sn bestup"
call LOADBRUSH("toaster:brushes/"||value("filenam")||"."||value(height))
call set_char(face,value("filenam")||"."||value(height))
call req_tell("Converted and loaded:",value("filenam")||"."||value("height"))
call req_bar("ToasterCG")
call REMLIB(CG_AREXX)
exit